<template>
    <div>
        <el-upload
                :action="action"
                list-type="picture-card"
                :on-preview="handlePictureCardPreview"
                :on-remove="handleRemove">
            <i class="el-icon-plus"></i>
        </el-upload>
        <el-dialog :visible.sync="dialogVisible">
            <img width="100%" :src="dialogImageUrl" alt="">
        </el-dialog>
    </div>
</template>

<script>
    import {upload_img} from "../../api/upload";


    export default {
        name: "upload-image",
        data() {
            return {
                dialogImageUrl: '',
                dialogVisible: false,
                action: "",

            }
        },
        methods: {
            handleRemove(file, fileList) {
                console.log(file, fileList);
            },
            handlePictureCardPreview(file) {
                console.log(file);
                this.dialogImageUrl = file.url;
                this.dialogVisible = true;
            }

        }
    }
</script>

<style scoped>

</style>
